package com.huxuesong.prcc.util;

import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

public class HttpUtil {

    public static void sendJsonMessage(HttpServletResponse response, Object obj) throws Exception {
        response.setContentType("application/json; charset=utf-8");
        PrintWriter writer = response.getWriter();
        writer.print(JsonUtils.toJsonStr(obj));
        writer.close();
        response.flushBuffer();
    }

}
